from selenium.webdriver.common.by import By

byid = By.ID
byname = By.NAME
bycname = By.CLASS_NAME
bytname = By.TAG_NAME
bylink = By.LINK_TEXT
bycss = By.CSS_SELECTOR
byxpath = By.XPATH
byparriallike = By.PARTIAL_LINK_TEXT

url = "http://10.59.9.8:7007/boss/"


# 登录界面元素配置信息
class LoginPageElements:
    # 用户名
    name_input = byname, 'loginName'
    # 密码
    pwd_input = byname, 'roncooPwd'
    # 登录按钮
    login_btn = byxpath, '//*[@id="form1"]/div[3]/input'
    # 首页标题
    dysuccess = byxpath,'/html/body/div[1]/div[2]/div[2]/div[1]/h2'
    # 登录失败断言
    dyfail = byxpath,'/html/body/div/div[1]/div/div/ul/li/a'

    # 结算管理按钮
    settlement_btn = byxpath,'/html/body/div[1]/div[2]/div[2]/div[2]/div[11]/h2'
    # 结算管理页面
    open_settlement = bycss,'/html/body/div[1]/div[2]/div[2]/div[2]/div[12]/ul/li/div/a'
    # 搜索输入框
    search_input = byxpath,'/html/body/div[1]/div[3]/div/div[2]/div[2]/div[1]/form/div/table/tbody/tr/td[1]/input'
    # 搜索按钮
    search_btn = bycname,'buttonActive'
    # 搜索断言
    dy_search=byxpath,'/html/body/div[1]/div[3]/div/div[2]/div[2]/div[2]/div[2]/div[2]/div/table/tbody/tr[1]/td[2]/div'
    # 关闭结算详情
    close_btn=bycname, 'close'

    # 添加按钮
    add_btn=bycname,'add'
    # 详情页断言
    detail_dy =bycname, "zftdgl"
    # 添加断言
    add_dy= bycname,'_blank'
    # 点击放大镜
    look=bycname,'btnLook'
    # 选择用户
    choose_user= byxpath,'/html/body/div[13]/div[2]/div[2]/div[2]/div[2]/div/table/tbody/tr[1]/td[2]/div'

    get_settlement= bycname,'readonly.textInput'

    get_settlement2 = bycname, 'required.digits.textInput'

    active_btn=bycname,'buttonActive'

roo_login_page = LoginPageElements()

